<template>
	<view>
		<view v-for="(item,index) in items" :key="item.id" class="addres-box">
			<view class="addres-left">
				<view>
					<view>{{item.name}}</view>
					<view>{{item.phoneNumber}}</view>
				</view>
			
				<view  class="addres-right">
					<uni-icons type="compose" size="30" class="icon"></uni-icons>
				</view>
			</view>
			
		</view>
		<view class="bottom" @tap="toNewAddress">新增地址</view>
		<!-- 尾巴 -->
	</view>
</template>

<script>
	import{
		findAllAddress
	}from "@/api/cart/address/index.js"
	export default {
		data() {
			return {
				items:[]
			};
		},
		methods:{
			toNewAddress(){
				uni.navigateTo({
					url:"/pages/home/cart/order/address/newAddress/newAddress"
				})
			}
		},
		onShow() {
			findAllAddress()
			.then(res=>{
				console.log(res)
				this.items = res.data.data.items
			})
		}
	}
</script>

<style lang="scss" scoped>
.addres-box{
	width: 90%;

	
	 margin: 0 auto;
padding: 10px 20px;
	.addres-left{
		width: 100%;
		position: relative;
	
			border-bottom: 1px #000000 solid;
			.addres-right{
				width: 30px;
				height: 30px;
				border-left: 1px #000000 solid;
				position: absolute;
				right: 0;
				top: 5px;
				.icon{
					margin-left: 10px;
				}
			}
		view{
			margin-bottom: 10px;
			
		}
	}
}
.bottom{
	width: 70%;
	height: 40px;
	border-radius: 16px;
	line-height: 40px;
	
	background-color: #354E44;
	text-align: center;
	color: #FFFFFF;
	position: fixed;
	bottom: 50px;
	left: 15%;
}
</style>
